package shark.picture.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import shark.picture.data.dto.uer.UserAddRequest;
import shark.picture.data.dto.uer.UserQueryRequest;
import shark.picture.data.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import shark.picture.data.vo.user.LoginUserVO;
import shark.picture.data.vo.user.UserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author jianxin.wei
* @description 针对表【user(用户)】的数据库操作Service
* @createDate 2025-02-11 10:37:01
*/
public interface UserService extends IService<User> {

    long userRegister(String userAccount, String userPassword, String checkPassword);

    LoginUserVO userLogin(String userAccount, String userPassword, HttpServletRequest request);

    User getLoginUser(HttpServletRequest request);

    boolean userLogout(HttpServletRequest request);


    Long addUser(UserAddRequest userAddRequest);

    UserVO getUserVO(User user);

    Wrapper<User> getQueryWrapper(UserQueryRequest userQueryRequest);

    List<UserVO> getUserVOList(List<User> records);

    /**
     * 是否为管理员
     *
     * @param user
     * @return
     */
    boolean isAdmin(User user);

}
